import Vuex from 'vuex';
import Vue from 'vue';

Vue.use(Vuex)

//this.$store.dispatch('set_x', true); 设置
//this.$store.getters.get_x 读取

const store = new Vuex.Store({

    state: {
        // 测试
        test: 0,
    },
    mutations: {
       
        // 测试
        SET_test(state, model) { state.test = model; },
    },
    actions: {
       
        // 测试
        set_test({ commit }, model) { commit('SET_test', model); },
    },
    getters: {
      
        // // 测试
        get_test: (state) => state.test,
    }
})
export default store;
